<?php
/**
 * 病例内调
 */
class DiagnosisDrugs{
  /**
   * @var string Identity药物编号
   */
  public $Id;
      
  /**
   * @var string Unique
   */
  public $DiagnosisId;
      
  /**
   * @var string Unique
   */
  public $DrugId;
      
  /**
   * @var string 药物名称
   */
  public $Name;
      
  /**
   * @var float 剂量
   */
  public $Number;
      
  /**
   * @var int 用药状态
   */
  public $Status;
      
  public function __construct(){
		$var=get_class_vars(__CLASS__);
    foreach(func_get_args() as $o){
      if(is_array($o)){
        foreach($o as $k => $v){
            if($k=='Id'){
              $this->Id=$v;
              }
            else if($k=='DiagnosisId'){
                $this->DiagnosisId=$v;
            }
            else if($k=='DrugId'){
                $this->DrugId=$v;
            }
            else if($k=='Name'){
                $this->Name=$v;
            }
            else if($k=='Number'){
                $this->Number=floatval($v);
            }
            else if($k=='Status'){
                $this->Status=intval($v);
            }
        }
      }else if(is_object($o)){
        foreach($var as $k => $v){
          if(isset($o->Id)){
            $this->Id=$o->Id;
          }
          if(isset($o->DiagnosisId)){
            $this->DiagnosisId=$o->DiagnosisId;
          }
          if(isset($o->DrugId)){
            $this->DrugId=$o->DrugId;
          }
          if(isset($o->Name)){
            $this->Name=$o->Name;
          }
          if(isset($o->Number)){
            $this->Number=$o->Number;
          }
          if(isset($o->Status)){
            $this->Status=$o->Status;
          }
        }
      }
    }
  }

  public function __modetoarray(){
    $var=array();
    foreach(get_class_vars(__CLASS__) as $k => $v){
      $var[$k]=$this->$k;
    }
	return $var;
  }
}
?>